Public Class Config
    Private mlID As Integer = DBBase.NODATA
    Private msName As String = ""
    Private msValue As String = ""

    Private mbObjectExists As Boolean = False

    Public Sub New()

    End Sub

    Public Sub New(ByVal lItemID As Integer)
        mlID = lItemID

        mbObjectExists = True
    End Sub

#Region "properties"
    Public Property ID() As Integer
        Get
            Return mlID
        End Get
        Set(ByVal Value As Integer)
            mlID = Value
        End Set
    End Property

    Public Property Name() As String
        Get
            Return msName
        End Get
        Set(ByVal Value As String)
            msName = Value
        End Set
    End Property

    Public Property Value() As String
        Get
            Return msValue
        End Get
        Set(ByVal Value As String)
            msValue = Value
        End Set
    End Property

    Friend Property ObjectExists() As Boolean
        Get
            Return mbObjectExists
        End Get
        Set(ByVal Value As Boolean)
            mbObjectExists = Value
        End Set
    End Property
#End Region

#Region "database"

    Public Sub Load()
        Dim oObject As New DBConfig

        oObject.Load(Me)
    End Sub

    Public Sub Save()
        Dim oObject As New DBConfig

        If mbObjectExists = True Then
            oObject.Update(Me)
        Else
            oObject.Add(Me)
        End If
    End Sub

    Public Sub Delete()
        Dim oObject As New DBConfig

        oObject.Delete(Me)

        mbObjectExists = False
    End Sub

#End Region
End Class
